package kotlin01

//泛型
fun main() {
    var name = printName("张三")
    var age = printName(18)

}


//泛型函数
fun <T> printName(name: T): T {
    println(name)
    return name

}

//泛型类
class GenericClass<T> constructor(var name: T) {
    fun s(): T {
        return name
    }
}